package edu.sjtu.context.core;

import java.io.Serializable;
import java.util.EventObject;

/**
 * Context change event. Encapsulate relative information for transformed context.
 * {@link LocalContextProb} and {@link RemoteContextProb} will create this event and 
 * send it to {@link LocalContextChangeListener} or {@link RemoteContextChangeListener}.
 * @author Roger
 *
 */
public class ContextChangeEvent extends EventObject implements Serializable {
	/**
	 * the name of context
	 */
	private String contextName;
	/**
	 * the value of the context
	 */
	private String contextValue;
	/**
	 * the name of the ontology which a Prob apply on
	 */
	private String ontName;
	/**
	 * the name of the class which individual will be set to keep the transformed context.
	 */
	private String className;
	/**
	 * Constructor.
	 * @param source
	 * 		Event source object.
	 * @param conName
	 * 		Context name.
	 * @param conValue
	 * 		Context value.
	 * @param ontName
	 * 		For a local context probe, this parameter should be set to empty. But for 
	 * 		remote context probe, this parameter should be set to the name of the ontology
	 * 		which the remote probe apply on.
	 */
	public ContextChangeEvent(Object source, String conName, String conValue, String ontName, String className) {
		super(source);
		this.contextName = conName;
		this.contextValue = conValue;
		this.ontName = ontName;
		this.className = className;
	}

	/**
	 * get the class name
	 * @return
	 * 		the name of the OWLNamedClass
	 */
	public String getClassName() {
		return className;
	}

	/**
	 * get name of the ontology which a Probe apply on.
	 * @return
	 * 		name of the ontology which a Probe apply on.
	 */
	public String getOntName() {
		return ontName;
	}

	/**
	 * Get context name.
	 * @return
	 */
	public String getContextName() {
		return contextName;
	}

	/**
	 * Get context value.
	 * @return
	 */
	public String getContextValue() {
		return contextValue;
	}
}
